﻿#include "HRibbonQuickAccessBar.h"
#include "HRibbonButtonGroupWidget.h"
#include "HRibbonSeparatorWidget.h"

/**
 * @brief The HRibbonQuickAccessBarPrivate class
 */
class HRibbonQuickAccessBarPrivate
{
public:
    HRibbonButtonGroupWidget *groupWidget;
};

HRibbonQuickAccessBar::HRibbonQuickAccessBar(QWidget *parent)
    : HRibbonCtrlContainer(nullptr, parent)
    , m_d(new HRibbonQuickAccessBarPrivate)
{
    m_d->groupWidget = new HRibbonButtonGroupWidget(this);
    setContainerWidget(m_d->groupWidget);
}


HRibbonQuickAccessBar::~HRibbonQuickAccessBar()
{
    delete m_d;
}


void HRibbonQuickAccessBar::addSeparator()
{
    m_d->groupWidget->addSeparator();
}


void HRibbonQuickAccessBar::addAction(QAction *act)
{
    m_d->groupWidget->addAction(act);
}


void HRibbonQuickAccessBar::addWidget(QWidget *w)
{
    m_d->groupWidget->addWidget(w);
}


void HRibbonQuickAccessBar::addMenu(QMenu *m, QToolButton::ToolButtonPopupMode popMode)
{
    m_d->groupWidget->addMenu(m, popMode);
}


void HRibbonQuickAccessBar::initStyleOption(QStyleOption *opt)
{
    opt->initFrom(this);
}
